//
//  Test14.cpp
//  CPPTest
//
//  Created by you5 Yi on 2021/9/15.
//

#include "Test14.hpp"
#include <string>
#include <iostream>
using namespace std;
class circle {
    double radius;
public:
    circle(double r) {
        radius = r;
    }
    double getarea() {
        return radius*radius*3.14;
    }
};
class table {
    double height;
public:
    table(double h) {
        height = h;
    }
    double getheight() {
        return height;
    }
};
class roundtable:public table,public circle {
    char *color;
public:
    roundtable(double h,double r,char c[]):circle(r),table(h) {
        color = new char[strlen(c)+1];
        strcpy(color, c);
    }
    char *getcolor() {
        return color;
    }
};

void test14() {
    roundtable rt(0.8,1.2,"黑色");
    cout<<"圆桌属性数据："<<endl;
    cout<<"高度："<<rt.getheight()<<endl;
    cout<<"面积："<<rt.getarea()<<endl;
    cout<<"颜色："<<rt.getcolor()<<endl;
}
